package cn.hchaojie.camp.day04;

// 没有构造器，编译器会创建一个默认的构造器
// 最后生成的java字节码文件里面，会看到这个默认的构造器

public class Teacher {
	private String name;
	private int experience;
	private char gender;		// 'M', 'F'
	
	public Teacher() {
	}
	
	// 如果你创建了一个带参数的构造器，那么编译器就不会创建默认无参的构造器
	public Teacher(String name) {
		// this.name = name;
		this(name, 0);		// 从一个构造器里面调用另外一个
	}
	
	public Teacher(String name, int experience) {
//		this.name = name;
//		this.experience = experience;
		this(name, experience, '\0');		// null 引用类型的初始值
	}

	public Teacher(String name, int experience, char gender) {
		this.name = name;
		this.experience = experience;
		this.gender = gender;
	}
	
	public void setName(String name) {
		this.name = name;
	}
}
